<template>
    <div :style="isDialog ? '' : 'height: 100%;'" >
      <el-dialog
        :title="title"
       :visible.sync="openDialog"
       :close-on-click-modal="false"
       width="90%"
       append-to-body
       v-if="isDialog"
       :z-index="zIndex"
        v-bind="$attrs"
      >
        <slot></slot>
        <el-divider></el-divider>
        <div class="flex-row justify-center align-center" style="height:40px;">
          <slot name="btn"></slot>
          <el-button
            type="primary"
            plain
            icon="el-icon-plus"
            size="mini"
            @click="$emit('submit')"
            v-if="showSubmit"
          >{{ submitText }}</el-button>
        </div>
      </el-dialog>

      <slot v-if="!isDialog"></slot>
    </div>
</template>

<script>
export default {
  name: '',
  components: {},
  props: {
    title: {},
    open: {
      default: () => false
    },
    isDialog: {
      default: () => true
    },
    submitText: {
      default: () => '提交'
    },
    showSubmit:{
      default: () => true
    },
    zIndex: {
      default: () => 9999
    }
  },
  data() {
    return {}
  },
  computed: {
    openDialog: {
      get(){
        return this.open
      },
      set(val){
        this.$emit('update:open',val)
      }
    }
  },
  methods: {},
  mounted() {

  }
}
</script>


<style scoped lang="scss">

</style>
